package com.zymail.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zymail.bean.ZyCollect;
import com.zymail.mapper.ZyCollectMapper;
import com.zymail.service.ZyCollectService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Dorado
 * @since 2021-04-12
 */
@Service
public class ZyCollectServiceImpl extends ServiceImpl<ZyCollectMapper, ZyCollect> implements ZyCollectService {

    @Override
    public List<ZyCollect> getcollect(Integer userId) {
        QueryWrapper<ZyCollect> wrapper = new QueryWrapper<>();
        wrapper.eq("user_id", userId);
        wrapper.orderByDesc("id");
        return list(wrapper);
    }
}
